﻿using Reservoir.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Reservoir.DAL
{
    public class UserDAL
    {
        ReservoirDbContent dbContent = new ReservoirDbContent();
        /// <summary>
        /// 通过用户名查找用户信息
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <returns></returns>
        public TBUser getUserByName(string Name)
        {
            TBUser user = dbContent.TBUser.FirstOrDefault(l => l.Name == Name);
            return user;
        }
        public TBUser FindByUserId(string Id)
        {
            return dbContent.TBUser.SingleOrDefault(m => m.Id == Id);
        }
        public TBUser get(string id)
        {
            return dbContent.TBUser.Find(id);
        }
    }
}
